package com.ruoyi.yljf.controller.AppController;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.security.annotation.Anonymous;
import com.ruoyi.yljf.domain.Doctor;
import com.ruoyi.yljf.domain.dto.DoctorDTO;
import com.ruoyi.yljf.service.IDoctorService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 医师Controller
 * 
 * @author metaee
 * @date 2025-02-14
 */
@Anonymous
@RestController
@RequestMapping("api/doctor")
public class ApiDoctorController extends BaseController {
    @Autowired
    private IDoctorService doctorService;


    /**
     * 查询医师派别列表
     */
    @GetMapping("/doctorTypeList")
    public AjaxResult doctorTypeList() {
        List list = doctorService.queryDoctorTypeList();
        return success(list);
    }

    /**
     * 查询医师派别列表V2(返回“全部”)
     */
    @GetMapping("/doctorTypeListV2")
    public AjaxResult doctorTypeListV2() {
        List list = doctorService.queryDoctorTypeListV2();
        return success(list);
    }

    /**
     * 字母排序查询医师列表
     */
    @GetMapping("/list")
    public AjaxResult list(DoctorDTO doctor) {
        return success(doctorService.queryDoctorList(doctor));
    }

    /**
     * 获取医师详细信息
     */
    @GetMapping(value = "/{doctorId}")
    public AjaxResult getInfo(@PathVariable("doctorId") Long doctorId) {
        return success(doctorService.getById(doctorId));
    }
    
}
